UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IGs6wyrchxZG7q6q5krt2uOo0C9EmGXtPYJ7eGaCGHA='
WHERE
key_id = 'a1dd35f91316d128ce7696fb98b52080740e38d15ee9c542836ba1ce99d75c91'
AND (
token = 'IGs6wyrchxZG7q6q5krt2uOo0C9EmGXtPYJ7eGaCGHA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)