UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '15g2kdFTA8Yh5RT1OsYw2DulnOZav14ZCtpLaxy/fiE=' 
WHERE 
  key_id = '7d50fddcb24a424c487ee2e8788c8efdedbf1e6a296f39b791443cdb6904ff4d' 
  AND (
    token = '15g2kdFTA8Yh5RT1OsYw2DulnOZav14ZCtpLaxy/fiE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038