UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '92NnGr3/MjoiS365xNCocCRBKJ0SsmLC9Fo0s87ZHkk='
WHERE
key_id = 'b4a9a1a8561ec465c9a57dfe8415d60a8c41544d070da1602fb8c9cb6e01aa40'
AND (
token = '92NnGr3/MjoiS365xNCocCRBKJ0SsmLC9Fo0s87ZHkk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)