UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'En1eaSG03uoOAldBZSCy3p3Gwa5lGzZVzkSVyOYVGkQ=' 
WHERE 
  key_id = '08bda6b25854bf2d50c16e7d9eb25365277cf8bd3a9c50e74343e2bc55d14cc8' 
  AND (
    token = 'En1eaSG03uoOAldBZSCy3p3Gwa5lGzZVzkSVyOYVGkQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034