UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J1c6m3AYd3/ZKs6ejXppY0jcR3Ygy+9aRyTB897UobM=' 
WHERE 
  key_id = 'ff72c2f4c06b83deb8284b990cf8c4c68405b9eb0d69c35e0f90d71c722b4e05' 
  AND (
    token = 'J1c6m3AYd3/ZKs6ejXppY0jcR3Ygy+9aRyTB897UobM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019