UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j7WCvBp6KEkqRv249NwfqDczCGVbNoynSx+hHHmlkjA=' 
WHERE 
  key_id = '89f76c80a3965b80c482922535773cbabdf2e04c8c2f75dc2ec8b925b5b4ebf7' 
  AND (
    token = 'j7WCvBp6KEkqRv249NwfqDczCGVbNoynSx+hHHmlkjA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018