UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eZ9XuTtqw7xSlCRW7dFl8xzyrq3GB+IEjHaaF+MIMQg=' 
WHERE 
  key_id = '93687f13075b0f2785f71de1a5598dedf636d90cce4407fd7349d180c62a5144' 
  AND (
    token = 'eZ9XuTtqw7xSlCRW7dFl8xzyrq3GB+IEjHaaF+MIMQg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033