UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QR3ZZQ5UpZLeoeecEWP/Uc+rWKaKUEv/yuFn8SbYpdc=' 
WHERE 
  key_id = '859350c9224b8d46ad45781fc21c098c9a835c15bfadfeca88c18e3b3aa67b2f' 
  AND (
    token = 'QR3ZZQ5UpZLeoeecEWP/Uc+rWKaKUEv/yuFn8SbYpdc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034