UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IG4cZ+8c/y6roT0ArpPNtfpy4UFcPXM6G4H4PM4q9Hk=' 
WHERE 
  key_id = 'fa7fd086d12e037fac6bd9bea7699e65beb8f0dca1bc1c0fb4978cf24706c89a' 
  AND (
    token = 'IG4cZ+8c/y6roT0ArpPNtfpy4UFcPXM6G4H4PM4q9Hk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024