UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Etvgl3CGc9xlVaEDDS3g0EJ78mJ7nb0n3HNajzsK1QE=' 
WHERE 
  key_id = 'ee135c7329c57ff9a893b06099e2bd7ad48b2922bebcfc99ee683b96364c56da' 
  AND (
    token = 'Etvgl3CGc9xlVaEDDS3g0EJ78mJ7nb0n3HNajzsK1QE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038