UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xESg3PFG700thLCPZSBvqAn5ti1RY6xM9vyXsOyNDHg='
WHERE
key_id = '90f9a64f254befb91d39f27bd3387de9c0f08dcd2bcde2dee68358c03db63be0'
AND (
token = 'xESg3PFG700thLCPZSBvqAn5ti1RY6xM9vyXsOyNDHg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)