UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cgX7l4t7OKW9eYI11MwzO0Yf5T0PFJ7pH6zknzBTFn8='
WHERE
key_id = '40e616ab8635bcb17e107d2dce9977d5fb30059e4c8730c6d6a2c559d3797a45'
AND (
token = 'cgX7l4t7OKW9eYI11MwzO0Yf5T0PFJ7pH6zknzBTFn8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)