UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fD2hz1mgT9+86TornJaQ+fv6q+g2EAoyjcTpB/HK7T0=' 
WHERE 
  key_id = '4bf91d1e5ae95a448e7c25bcee502481b43696b3a1553575a7cd40847dedb030' 
  AND (
    token = 'fD2hz1mgT9+86TornJaQ+fv6q+g2EAoyjcTpB/HK7T0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025