UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vc6e1fCcFLGf9u017MqciTbq3gp/mKkz7I2rG5CDekU=' 
WHERE 
  key_id = 'db60ab4fb2ac38de25050b3714ced9ea329d48edc871fa864f8d6ac8a85b5c3e' 
  AND (
    token = 'Vc6e1fCcFLGf9u017MqciTbq3gp/mKkz7I2rG5CDekU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020