UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QjQkWz0WdAI5U3xT9JWnDz+zxGUFzQR/FhLOvxeSAjA=' 
WHERE 
  key_id = 'd3f8e2c4073f43d0d6a014dbc75609a8a612b76e77069415b3b2c8b0744a7074' 
  AND (
    token = 'QjQkWz0WdAI5U3xT9JWnDz+zxGUFzQR/FhLOvxeSAjA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025