UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zb3jBYtFLJ+YIQo6mx+qA/p0w16ES1m5V6Z9WedObVc='
WHERE
key_id = '99ccd0f30f829936e671778ba57e69ef29608c820ee608931e3adeaa98ec004b'
AND (
token = 'zb3jBYtFLJ+YIQo6mx+qA/p0w16ES1m5V6Z9WedObVc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)