UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kJMJCeUhM7Vx+ol1zlSUumszkrK1wfyTrXw0kP938WY='
WHERE
key_id = 'ccb64f5e523bafea59eb232a1cf4d58da6eaaca7d26b0a268e39eb5eec1f65bb'
AND (
token = 'kJMJCeUhM7Vx+ol1zlSUumszkrK1wfyTrXw0kP938WY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)