UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BXTUZzSw0/lfgJSk9PP1NzV6QELYDUsnfCf0PoBc24I=' 
WHERE 
  key_id = '200ac050f0e75006c07b2f30af956bdbe8b93901e48fd2909482033a1aa52a7e' 
  AND (
    token = 'BXTUZzSw0/lfgJSk9PP1NzV6QELYDUsnfCf0PoBc24I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029