UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nPaWmYXlYc07gOycrCNo6N2WToKlGPAK2DHNF+0gM74=' 
WHERE 
  key_id = 'db241606f5eb3517d580de13d3df2f1f64bf86d2dff9f60a122e41062ccd773a' 
  AND (
    token = 'nPaWmYXlYc07gOycrCNo6N2WToKlGPAK2DHNF+0gM74=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061