UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zI60s5ZbtCFOjlqvdOSu7gIKTsmciXpZunyF62LMbPo='
WHERE
key_id = '5676386ab53f5b63b119f083f4ebf07c886b3cff5e38ed62fe2f481ed9396e52'
AND (
token = 'zI60s5ZbtCFOjlqvdOSu7gIKTsmciXpZunyF62LMbPo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)