UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1dIIlIRfJUrE/WqUg0gVrZKRKoG3WaAgJPOPGAxNtwU=' 
WHERE 
  key_id = '2b1045786735f26cb99304b8598c077784890e8aa02c35359cc219cb416927e2' 
  AND (
    token = '1dIIlIRfJUrE/WqUg0gVrZKRKoG3WaAgJPOPGAxNtwU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031