UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6u1WmJxueeueGh5bBnrEbs5r7Glp9QSIy5PrH1o6IGI='
WHERE
key_id = 'e05bc78024c69b76763af47287c879d9e045137ac73f6fc997a7bca94ea4bcb3'
AND (
token = '6u1WmJxueeueGh5bBnrEbs5r7Glp9QSIy5PrH1o6IGI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)