UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FegjEmYfxPNEt7Ky3XHeX+jtPUmyIzGpin7xLF1XDco=' 
WHERE 
  key_id = '7e2fb5cc2c28b2088426327683153d0fa80605f8af39109ad322bbf30d99fe1e' 
  AND (
    token = 'FegjEmYfxPNEt7Ky3XHeX+jtPUmyIzGpin7xLF1XDco=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036