UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NMmrHfPomV9pad7Y/s9Wwe3/lXvhGcqoun8JkDeWc5I=' 
WHERE 
  key_id = '45be084e45755f55f1ccac6862b2e1854e7e6f88d3e1922afead69aaec35ede4' 
  AND (
    token = 'NMmrHfPomV9pad7Y/s9Wwe3/lXvhGcqoun8JkDeWc5I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020