UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ye1Kc6WqWZwe/cJoG2IL3oM7k8fbOA3a6Z9v4k2Q8Ro=' 
WHERE 
  key_id = 'a3a9f4cdcef55ca3c018680972685a207b6ef2aea094ba043b741a1cccef2959' 
  AND (
    token = 'Ye1Kc6WqWZwe/cJoG2IL3oM7k8fbOA3a6Z9v4k2Q8Ro=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033