UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7yWr0Kzlq0GxcKJcs/Ylx6DKEVkl5SMmugQC8xJKdE8=' 
WHERE 
  key_id = 'c75f3e2a80f6cf0984bb9ef36f6f1c8237d15dabc135365768e446ebf429bc63' 
  AND (
    token = '7yWr0Kzlq0GxcKJcs/Ylx6DKEVkl5SMmugQC8xJKdE8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024