UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uw3BHgwZx+IjKxUoTjrGs6GRPYvuQ/0GqjvXyhUuJ8A='
WHERE
key_id = '6c5ea715ce8d3aeedfb896114137350fae74eb56ea08e570ec61512585396f91'
AND (
token = 'uw3BHgwZx+IjKxUoTjrGs6GRPYvuQ/0GqjvXyhUuJ8A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)