UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sqlhdaO2dSwhvuGwvQVlRTV+hFX0H320YooN8yLDSNo=' 
WHERE 
  key_id = 'f63867617f23d1a2f71ed06b84ad66ae0a259cd692acfcdf8759926bd8b18d0f' 
  AND (
    token = 'sqlhdaO2dSwhvuGwvQVlRTV+hFX0H320YooN8yLDSNo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024