UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j3ua2HEqLTVrztM7EmUtG/lApH1xlNRdUaxScOIQh1U=' 
WHERE 
  key_id = 'e17cab2f31141646b1ea775d613957b7d446c0d4ca9b818a921c13e1e31f7b1c' 
  AND (
    token = 'j3ua2HEqLTVrztM7EmUtG/lApH1xlNRdUaxScOIQh1U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043