UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MHwfSRoRN7knMtLzd91lOZaEvSA/INb5Fl/ubZhoEiQ=' 
WHERE 
  key_id = '6621676b044fabf4835fbd20d61b750a8811590f59cd2e0b8a207cbe9b9e6732' 
  AND (
    token = 'MHwfSRoRN7knMtLzd91lOZaEvSA/INb5Fl/ubZhoEiQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047