UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FJ2JgT1QjA+cmHslsS7gFW/oF4vFg2YmzmxCEWaiO7g=' 
WHERE 
  key_id = '3e7d898e8336e34c11f079519c036d830471003d3f0d4f3a7bdf73cff856369f' 
  AND (
    token = 'FJ2JgT1QjA+cmHslsS7gFW/oF4vFg2YmzmxCEWaiO7g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051