UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 's8jndXRhC0qhkj3HYJG25UAyu2mhBTJOXH8PMDVl9Oc=' 
WHERE 
  key_id = '7b50e8e3c7aeb5a5cafb80214d1f9991bc703ff445a580d6f1fdde795d8444da' 
  AND (
    token = 's8jndXRhC0qhkj3HYJG25UAyu2mhBTJOXH8PMDVl9Oc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035