UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aooQQypLLp2FbyO/tXN5j73a+QZWgsC81jhZ/S2uHAw='
WHERE
key_id = 'e3eea8717f0bfefc7aa98c12a7f98bafbe937ea4befc47bbadc95e950df891b3'
AND (
token = 'aooQQypLLp2FbyO/tXN5j73a+QZWgsC81jhZ/S2uHAw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)