UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3De0GFTYFslGC9KXlLK+At1uKiOEA/SQq1aXdO9Cuos='
WHERE
key_id = '0e8b097f8b61a29f4f2bafc35d28abe4dba083a07a59933f751e27dd58f595e7'
AND (
token = '3De0GFTYFslGC9KXlLK+At1uKiOEA/SQq1aXdO9Cuos='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)