UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rHQ2xcU88xP3nyTFZH2cg/JlPN2fUKte9rLOaSnuEVI=' 
WHERE 
  key_id = '978f11a792e26f32c5cab73013522708ed04fd022b5998dd62acb794e6789a1f' 
  AND (
    token = 'rHQ2xcU88xP3nyTFZH2cg/JlPN2fUKte9rLOaSnuEVI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033