UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'drrHUS/JEqKUbAAmNwVqGLmZL7GUFTuu0NDNVNXYA9c='
WHERE
key_id = '4c8530923cf052eac6f20d5d52f625afed1381004c379592c2851500b0f68764'
AND (
token = 'drrHUS/JEqKUbAAmNwVqGLmZL7GUFTuu0NDNVNXYA9c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)