UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CqkFYMVBZG+tvAui9BPZtEjltN//SU+hGWhtJ8YDmOc='
WHERE
key_id = '199abf2f0f05734a8e576bd3dbace31cf79844ed60c23afbd941dc95fd8c2b0b'
AND (
token = 'CqkFYMVBZG+tvAui9BPZtEjltN//SU+hGWhtJ8YDmOc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)