UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VrPcdFJXRYC+P7Gm2wv/nv8UseE9+9rx9CQv8J17ERY='
WHERE
key_id = 'edeb1ac7a02d2b9f418e6eb1ad0bcb7022573f5816feb32075fbf1bb473e6deb'
AND (
token = 'VrPcdFJXRYC+P7Gm2wv/nv8UseE9+9rx9CQv8J17ERY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)