UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GMDjjrZwgglIo2vXsod8zERTmzVfjm+ExQFROruqn84=' 
WHERE 
  key_id = 'fc2e1c5a83a125ef48e05f1a196b2d9a2a4c4545f4959d9f00e2857924f99400' 
  AND (
    token = 'GMDjjrZwgglIo2vXsod8zERTmzVfjm+ExQFROruqn84=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029