UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'n1IBxheqBbLkLkn1zRix59aMAUh134JAyPwyCovVP9I=' 
WHERE 
  key_id = '47392fafcb75b6e3d18e04786fd516f5dcf57bcf6697b918efd19ecab098dd48' 
  AND (
    token = 'n1IBxheqBbLkLkn1zRix59aMAUh134JAyPwyCovVP9I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032