UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZPE17SIlS5GtB+983VnNQf/wF7v9uyUBbTKzY5MuPNc=' 
WHERE 
  key_id = '7f615da970a8aba90ae15db349098896c2be8540e6b021347a05abc6bc56b7ad' 
  AND (
    token = 'ZPE17SIlS5GtB+983VnNQf/wF7v9uyUBbTKzY5MuPNc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034