UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1Cbc/7mVfwydbZDoYyHyN1gCCS0VR+laXvqpg4EG2oU='
WHERE
key_id = 'ce57bc6a3dfc4b3bfbc20d98955db7b4cd9acdb3b377f7763d0e45cf2e149d83'
AND (
token = '1Cbc/7mVfwydbZDoYyHyN1gCCS0VR+laXvqpg4EG2oU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)