UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q5ub0QnrpXQxXHB4WnM/AwDXDeZw9ST6o/C1eWuPl/Y='
WHERE
key_id = 'da7ce4293d491eb2dff720f93ca6bf547415b2e9d1a0b5ebea8c936b4a8c88e3'
AND (
token = 'Q5ub0QnrpXQxXHB4WnM/AwDXDeZw9ST6o/C1eWuPl/Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)